#!/bin/bash

KEYWORD_STRING=$(echo $1 | sed 's/\.cl$//')
TARGET_FILENAME=$KEYWORD_STRING"_cl.cpp"
echo $TARGET_FILENAME

echo "const char *cl_source_$KEYWORD_STRING =" > $TARGET_FILENAME
tr -d "\r" < $1 | sed 's/\\/\\\\/g' | sed 's/\"/\\\"/g' | sed 's,^\(.*\)$,\"\1\\n\",' >> $TARGET_FILENAME
echo ";" >> $TARGET_FILENAME 
